//
//  TodoWarnViewController.m
//  Rail
//
//  Created by hychen on 2018/2/28.
//  Copyright © 2018年 Hychen. All rights reserved.
//

#import "TodoWarnViewController.h"
#import "MJCSegmentInterface.h"

#import "TodoWarnAllViewController.h"
#import "TodoWarnUnViewController.h"
#import "TodoWarnDoneViewController.h"
@interface TodoWarnViewController ()

@end

@implementation TodoWarnViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    TodoWarnAllViewController *allVc = [TodoWarnAllViewController new];
    TodoWarnUnViewController *unVc = [TodoWarnUnViewController new];
    TodoWarnDoneViewController *doneVc = [TodoWarnDoneViewController new];
    
    if (self.eventModel) {
        allVc.eventModel = self.eventModel;
        unVc.eventModel = self.eventModel;
        doneVc.eventModel = self.eventModel;
    }
    
    NSArray *vcArray = @[allVc,unVc,doneVc];
    NSArray *titleArray = @[@"全部",@"未处理",@"已处理"];
    
    MJCSegmentInterface *interface = [MJCSegmentInterface jc_initWithFrame:CGRectMake(0,0,self.view.jc_width, self.view.jc_height-kStatusBarAndNavBarHeight) interFaceStyleToolsBlock:^(MJCSegmentStylesTools *jc_tools) {
        jc_tools.
        jc_titlesViewFrame(CGRectMake(0, 0, self.view.jc_width, 40)).
        jc_childScollEnabled(YES).
        jc_itemBackColor([UIColor whiteColor]).
        jc_childScollAnimalEnabled(YES).
        jc_itemTextSelectedColor(Color_RGB(0, 193, 224)).
        jc_itemTextNormalColor(Color_RGB(130, 130, 130)).
        jc_itemTextFontSize(14).
        jc_indicatorStyles(MJCIndicatorItemTextStyle).
        jc_itemSelectedSegmentIndex(0).
        jc_indicatorColor(Color_RGB(0, 193, 224)).
        jc_indicatorHidden(NO);
    }];
    
    interface.selectedSegmentIndex = self.defaultIndex;
    
    [self.view addSubview:interface];
    [interface intoTitlesArray:titleArray intoChildControllerArray:vcArray hostController:self];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


- (void)setNavTitle:(NSString *)navTitle {
    _navTitle = navTitle;
    [self.navigationItem addSimpleTitleView:navTitle];
}

- (void)setEventModel:(InformationEventModel *)eventModel {
    _eventModel = eventModel;
    self.navTitle = eventModel.event_name;
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
